
<title>User History Page</title>


<?php 

/*

***************************************
*                                     *
* Copyright 2011 David Matthew Pugh   *
* Contact Info:thebravedave@gmail.com *
*                                     *
***************************************

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
   
require_once "../services/webservices.php";
require_once "index.php";
require_once("../Pagination.php");

$Pagination = new Pagination();  
echo $Pagination->getEmbeddedCssStyling();
?>




<?php
print "<br /><br /><br /><br /><br />"; 
 echo '<link href="./includes/style.css" rel="stylesheet" type="text/css" />';                   
    $getrequest = new members();      
    if(isset($_GET['limit']))
    {
        $limit = $_GET['limit'];
        $getrequest->limit = $limit;
        
    }
    else
    {
        $limit = 25;
        $getrequest->limit = $limit;
    }
    if(isset($_GET['page']))
    {
        $page = $_GET['page'];
        $getrequest->page = $page;
    }
    else
    {
        $page = 1;
        $getrequest->page = $page;   
    }
    
  
    
    $getresponse = $getrequest->getuserhistory();  
 
    $xml = new SimpleXMLElement($getresponse);
    
    $item_count = $xml->Item_Count;
    $item_count = (int)$item_count; 
    echo '<b><h2>User History</h2></b>';
    $total_pages = $item_count;
    if($item_count != 0)
    {   
                
        foreach($xml->Item as $eachitem)
        {   
            $id = $eachitem->id; 
            $username = $eachitem->username;
            $time = $eachitem->time;
 ?>         
            <div class="doubleborderrightmargin">      
            <?php echo '<b>User Name:</b>' . $username . '<br />';?>
            <?php echo '<b>Login Time:</b>' . $time . '<br /><br /><br />';?>
            </div>
 <?php
        }
        
    }
    else
    {
        echo '<b>No User History Available</b>';
    }

////////////////////////////S T A R T  P A G I N A T I O N  C O D E ////////////////////////////////S T A R T  P A G I N A T I O N  C O D E ///////////////////////////////////////////////////////////////////////  
    $Pagination->totalItems = $item_count;
    $Pagination->targetPage = "userhistory.php";
    $Pagination->page = $page;
    $Pagination->limit = $limit;  
    $Pagination->addToUrlVarArray("limit=$limit");
    $Pagination->setUrlVariables();
    $Pagination->getPaginationLinkBar();      
/////////////////////////////////////////////////////////////////////E N D  P A G I N A T I O N  C O D E//////////////////////////////////////////////////////////////////////////////////////////////  
?>
